package org.aspire.graphics;

import org.aspire.core.sys.GameException;

/******************************************************************************
 * An object that provide functionalities for drawing graphics to the screen.
 * 
 * @author JPACarabuena
 *****************************************************************************/
public interface DrawGraphics {
	
	// ========================================================================
	// Final Fields
	// ========================================================================

	// ========================================================================
	// Getters & Setters
	// ========================================================================

	public Color getColor();
	
	public void setColor(Color color);
	
	// ========================================================================
	// Override Methods
	// ========================================================================

	// ========================================================================
	// Methods
	// ========================================================================
	
	/**************************************************************************
	 * Draw a line starting from the specified x1 and y1 points up to the
	 * specified x2 and y2 points.
	 * 
	 * @param x1	the first x coordinate.
	 * @param y1	the first y coordinate.
	 * @param x2	the second x coordinate.
	 * @param y2	the second y coordinate.
	 *************************************************************************/
	public void drawLine(int x1, int y1, int x2, int y2);
	
	/**************************************************************************
	 * Draw a rectangle at the specified location with the specified dimension.
	 * 
	 * @param x	the 	x-coordinate of the rectangle.
	 * @param y	the 	y-coordinate of the rectangle.
	 * @param width		the width of the rectangle.
	 * @param height	the height of the rectangle.
	 *************************************************************************/
	public void drawRect(int x, int y, int width, int height);
	
	/**************************************************************************
	 * Draw a rectangle at the specified location with the specified dimension.
	 * It fills the area occupied by the rectangle with the current color of
	 * the graphics renderer.
	 * 
	 * @param x			x-coordinate of the rectangle.
	 * @param y			y-coordinate of the rectangle.
	 * @param width		the width of the rectangle.
	 * @param height	the height of the rectangle.
	 *************************************************************************/
	public void fillRect(int x, int y, int width, int height);
	
	/**************************************************************************
	 * Draw an oval that fits inside the specified rectangle.
	 * 
	 * @param x			x-coordinate of the rectangle.
	 * @param y			y-coordinate of the rectangle.
	 * @param width		the width of the rectangle.
	 * @param height	the height of the rectangle.
	 *************************************************************************/
	public void drawOval(int x, int y, int width, int height);
	
	/**************************************************************************
	 * Draw an oval that fits inside the specified rectangle. It fills the area
	 * occupied by the rectangle with the current color of the graphics
	 * renderer.
	 * 
	 * @param x			x-coordinate of the rectangle.
	 * @param y			y-coordinate of the rectangle.
	 * @param width		the width of the rectangle.
	 * @param height	the height of the rectangle.
	 *************************************************************************/
	public void fillOval(int x, int y, int width, int height);
	
	/**************************************************************************
	 * Draw a closed polygon from the specified x and y coordinates. It might
	 * throw an exception if the specified points does not form a closed
	 * polygon or the number of points specified does not match the actual
	 * number of points.
	 * 
	 * @param xPoints	the x-coordinates of the polygon.
	 * @param yPoints	the y-coordinates of the polygon.
	 * @param nPoints	the number of points of the polygon.
	 * @throws GameException 
	 * 					An exception triggered by formation of unclosed polygon
	 * 					or mismatch in the number of expected and actual
	 * 					vertices.
	 *************************************************************************/
	public void drawPolygon(int[] xPoints, int[] yPoints,
			int nPoints) throws GameException;
	
	/**************************************************************************
	 * Draw a closed polygon from the specified x and y coordinates. It might
	 * throw an exception if the specified points does not form a closed
	 * polygon or the number of points specified does not match the actual
	 * number of points. It fills the area occupied by the polygon with the
	 * current color of the graphics renderer.
	 * 
	 * @param xPoints	the x-coordinates of the polygon.
	 * @param yPoints	the y-coordinates of the polygon.
	 * @param nPoints	the number of points of the polygon.
	 * @throws GameException
	 * 					An exception triggered by formation of unclosed polygon
	 * 					or mismatch in the number of expected and actual
	 * 					vertices.
	 *************************************************************************/
	public void fillPolygon(int[] xPoints, int[] yPoints,
			int nPoints) throws GameException;
	
	/**************************************************************************
	 * Draw the specified string at the specified location with the current
	 * font of the graphics renderer.
	 * 
	 * @param str	the string to be drawn.
	 * @param x		the x-coordinate of the string.
	 * @param y		the y-coordinate of the string.
	 *************************************************************************/
	public void drawString(String str, int x, int y);
	
	/**************************************************************************
	 * Draw the specified image at the specified location.
	 * @param image TODO
	 * @param x		the x-coordinate of the image.
	 * @param y		the y-coordinate of the image.
	 *************************************************************************/
	public void drawImage(Frame image, int x, int y);
	
	// ========================================================================
	// Inner & Anonymous Classes
	// ========================================================================
}
